package cn.com.generaldata.os.service.indicator_evaluation.prosperity_analysis;

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.entity.Record;
import org.nutz.dao.impl.sql.SqlTemplate;
import org.nutz.dao.sql.Criteria;
import org.nutz.lang.random.R;

import cn.com.generaldata.jsme_indicator_system.entity.IndicatorEvaluation;
import cn.com.generaldata.os.pojo.IndicatorEvaluationResult;
import cn.com.generaldata.os.service.indicator_constant.ProvinceIndicatorConstant;
import cn.com.generaldata.os.service.indicator_evaluation.IndicatorEvaluationCalculateService;
import cn.com.generaldata.os.vo.IndicatorAccountVO;

/**
 * 二期 合成指数先行、滞后、一致基础指标-海洋生产总值增加值计算类
 * 2017-6-14
 */
public class HczsHysczzCalculateService extends IndicatorEvaluationCalculateService {


	@Override
	protected Double calculate(IndicatorEvaluation indicator, IndicatorAccountVO indicatorAccountVO) {

		Double newVal = 0d;
	
		//获取基础指标值-从录入指标或核算指标取
		Double warningIndicatorVal = getInputOrAccountingIndicatorValue(indicatorAccountVO,
				indicatorAccountVO.getYear(), indicator.getReference());//选择年海洋生产总值
		if (warningIndicatorVal==null || warningIndicatorVal.equals("")) {
			warningIndicatorVal=0d;
		}
		//计算生产总值增加值
		Double oldVal = getInputOrAccountingIndicatorValue(indicatorAccountVO,
				indicatorAccountVO.getYear()-1, indicator.getReference());//去年海洋生产总值
		if (oldVal==null || oldVal.equals("")) {
			oldVal=0d;
		}
		newVal = warningIndicatorVal-oldVal;
	
		return newVal;
	}

}
